package com.yuxi.Dao.Impl;

import java.io.Serializable;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.sun.xml.internal.ws.wsdl.writer.document.Port;
import com.yuxi.Dao.InformationPortPowerDao;
import com.yuxi.Entity.CommentRecordBrowse;
import com.yuxi.Entity.InformationPortPower;

@Repository
public class InformationPortPowerDaoImpl extends BaseDaoImpl<Serializable,Serializable> implements InformationPortPowerDao {
	private Logger logger=LoggerFactory.getLogger(InformationPortPowerDaoImpl.class);
	public InformationPortPowerDaoImpl(){
		super(InformationPortPower.class);
	}
	
	@Override
	public List<InformationPortPower> getPortPowerByRoleId(Integer roleId) {
		try {
			List<InformationPortPower> powers = super.find("from InformationPortPower where roleId=?",roleId);
			return powers;
		} catch (Exception e) {
			return null;
		}
	}

	@Override
	public InformationPortPower addPortPower(InformationPortPower portPower) {
		// TODO Auto-generated method stub
		return (InformationPortPower)super.addAndReturn(portPower);
	}

	@Override
	public void modifyPortPower(InformationPortPower portPower) {
		// TODO Auto-generated method stub
		super.update(portPower);
	}

	@Override
	public void deletePortPower(InformationPortPower portPower) {
		// TODO Auto-generated method stub
		super.delete(portPower);
	}

	@Override
	public void deletePortPowerByRoleId(Integer roleId) {
		// TODO Auto-generated method stub
		super.delete("delete  InformationPortPower where roleId=?", roleId);
	}

}
